This example demonstrates how to assign an "onmouseenter" and "onmouseleave" event to a h1 element.

Mouse over me

This example demonstrates the difference between onmousemove, onmouseenter and onmouseover.

The onmousemove event occurs every time the mouse pointer is moved over the div element.

The mouseenter event only occurs when the mouse pointer enters the div element.

The onmouseover event occurs when the mouse pointer enters the div element, and its child elements (p and span).

onmousemove:
Mouse over me!

onmouseenter:
Mouse over me!

onmouseover:
Mouse over me!